package com.example.demo.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.demo.entity.oldpartsmanage;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.Date;
import java.util.List;

@Mapper
public interface oldpartsmanageMapper extends BaseMapper<oldpartsmanage> {
    @Insert("insert into view_oldpartsmanage(mmcode,SPAcode,smcode,cname,model,num,company,uprice,wtime,dtime,skey) " +
            "value(#{mmcode},#{SPAcode},#{smcode},#{cname},#{model},#{num},#{company},#{uprice},#{wtime},#{dtime},#{skey})")
    public int Storage(oldpartsmanage oldpartsmanage);

    @Select("select * from view_oldpartsmanage where okey=#{okey}")
    public List<oldpartsmanage> selectOkey(oldpartsmanage oldpartsmanage);

    @Update("update view_oldpartsmanage set dtime=#{dtime} where okey=#{okey}")
    public int Outbound(int okey, String dtime);

    @Update("update view_oldpartsmanage set mmcode=#{mmcode},SPAcode=#{SPAcode},smcode=#{smcode},cname=#{cname}," +
            "model=#{model},num=#{num},company=#{company},uprice=#{uprice},wtime=#{wtime},dtime=#{dtime},skey=#{skey} " +
            "where okey=#{okey}")
    public int updateoldpartsmanage(oldpartsmanage oldpartsmanage);
}
